unit udmUretim;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  DBTables, ADODB, Db;
type
  Tdm = class(TDataModule)
    grups: TDataSource;
    agrups: TDataSource;
    stoks: TDataSource;
    markas: TDataSource;
    Connect: TADOConnection;
    MARKA: TADOQuery;
    GRUP: TADOQuery;
    AGRUP: TADOQuery;
    spgrupekle: TADOStoredProc;
    spgrupsil: TADOStoredProc;
    spgrupduzelt: TADOStoredProc;
    spagrupekle: TADOStoredProc;
    spagrupduzelt: TADOStoredProc;
    spagrupsil: TADOStoredProc;
    spMarkaekle: TADOStoredProc;
    spStok: TADOStoredProc;
    stokaras: TDataSource;
    spCari: TADOStoredProc;
    spCaris: TDataSource;
    spcariaraS: TDataSource;
    spCaYetkiliS: TDataSource;
    spCaYetkili: TADOStoredProc;
    spFatHar: TADOStoredProc;
    FatharS: TDataSource;
    spFatura: TADOStoredProc;
    FaturaS: TDataSource;
    spdepo: TADOStoredProc;
    depos: TDataSource;
    Fataras: TDataSource;
    spfatara: TADOStoredProc;
    spHarHarEkle: TADOStoredProc;
    garanti1: TADOStoredProc;
    garanti1s: TDataSource;
    garanti2: TADOStoredProc;
    garanti2s: TDataSource;
    serinovarmi: TADOStoredProc;
    spHarHarUpdate: TADOStoredProc;
    AGRUPGRKOD: TSmallintField;
    AGRUPisim: TWideStringField;
    GRUPGRKOD: TSmallintField;
    GRUPisim: TWideStringField;
    GRUPsil: TIntegerField;
    spserinoal: TADOStoredProc;
    spserinosil: TADOStoredProc;
    serinoals: TDataSource;
    spcariara: TADOStoredProc;
    spfatharhar: TADOStoredProc;
    spfatharhars: TDataSource;
    spparcaeklesil: TADOStoredProc;
    spserinover: TADOStoredProc;
    spmakinaliste: TADOStoredProc;
    sppersonel: TADOStoredProc;
    spmakinalistes: TDataSource;
    spuretim: TADOStoredProc;
    spdevam: TADOStoredProc;
    sppersonel2: TADOStoredProc;
    spFatHarbilisno: TIntegerField;
    spFatHarsira: TIntegerField;
    spFatHarstokkod: TIntegerField;
    spFatHarmiktar: TFloatField;
    spFatHarbirim: TWideStringField;
    spFatHardepokod: TIntegerField;
    spFatHartipi: TWideStringField;
    spFatHarbasildi: TWideStringField;
    spFatHargarantisuresi: TSmallintField;
    spFatHargarantivarmi: TWideStringField;
    spFaturabilisno: TAutoIncField;
    spFaturacarikod: TIntegerField;
    spFaturatarih: TDateTimeField;
    spFaturabelgeno: TWideStringField;
    spFaturabelgetarihi: TDateTimeField;
    spFaturaozelkod1: TWideStringField;
    spFaturaaciklama: TWideStringField;
    spFaturatipi: TWideStringField;
    Ayarlar: TADOQuery;
    spDepoHar: TADOStoredProc;
    spDepoHarStokkodu: TStringField;
    spDepoHarCinsi: TStringField;
    DepoHarS: TDataSource;
    spDepoHarUpdate: TADOStoredProc;
    spDepoHarbilisno: TIntegerField;
    spDepoHarsira: TIntegerField;
    spDepoHarstokkod: TIntegerField;
    spDepoHarmiktar: TFloatField;
    spDepoHarbirim: TWideStringField;
    spDepoHardepokod: TIntegerField;
    spDepoHartipi: TWideStringField;
    spDepoHarbasildi: TWideStringField;
    spDepoHargarantisuresi: TSmallintField;
    spDepoHargarantivarmi: TWideStringField;
    DepoStokBul: TADOQuery;
    spdepotran: TADOStoredProc;
    spDepoTrAra: TADOStoredProc;
    spDepoTrAras: TDataSource;
    qKargo: TADOQuery;
    spFaturatesalan: TIntegerField;
    spFaturateseden: TIntegerField;
    stBarkod: TADOQuery;
    stBarkods: TDataSource;
    stBirimler: TADOQuery;
    StokAra: TADOQuery;
    stBarkodbirimadi: TStringField;
    stBarkodcarpan: TFloatField;
    stBarkodbarkod: TStringField;
    stBarkodsatsekil: TStringField;
    stBarkodyuks: TFloatField;
    stBarkodgen: TFloatField;
    stBarkoduzun: TFloatField;
    stBarkodbrut: TFloatField;
    stBarkodstokkod: TIntegerField;
    Doviz: TADOQuery;
    kdv: TADOQuery;
    StDagiticiS: TDataSource;
    stDagitici: TADOQuery;
    CariTuru: TADOQuery;
    CaHesap: TADOQuery;
    CaHesapS: TDataSource;
    cabankahes: TADOQuery;
    cabankahesS: TDataSource;
    CariAra: TADOQuery;
    CariAraS: TDataSource;
    spFatHarfiyati: TBCDField;
    spFatHardovizkod: TSmallintField;
    spFatHarTLFiyati: TBCDField;
    spFatHarKDVorani: TFloatField;
    spFatHarKDVTutari: TBCDField;
    spFatHarkvSizTut: TBCDField;
    spFatHariskontoT: TBCDField;
    spFatHariskontoY: TFloatField;
    spFatHariskontoT1: TBCDField;
    spFatHariskontoT2: TBCDField;
    spFatHariskontoT3: TBCDField;
    spFatHariskontoT4: TBCDField;
    spFatHariskontoT5: TBCDField;
    spFatHariskontoY1: TFloatField;
    spFatHariskontoY2: TFloatField;
    spFatHariskontoY3: TFloatField;
    spFatHariskontoY4: TFloatField;
    spFatHariskontoY5: TFloatField;
    spFatHaraciklama: TStringField;
    spFatHarfiyatformu: TIntegerField;
    spFaturakdvdahil: TStringField;
    spFaturaackap: TStringField;
    spFaturaodemetipi: TStringField;
    spFaturavadetar: TDateTimeField;
    spFaturamasraf: TBCDField;
    spFaturatopindY: TFloatField;
    spFaturatopindT: TBCDField;
    spFaturatopindT1: TBCDField;
    spFaturatopindT2: TBCDField;
    spFaturatopindT3: TBCDField;
    spFaturatopindT4: TBCDField;
    spFaturatopindT5: TBCDField;
    spFaturatopindY1: TFloatField;
    spFaturatopindY2: TFloatField;
    spFaturatopindY3: TFloatField;
    spFaturatopindY4: TFloatField;
    spFaturatopindY5: TFloatField;
    spFaturaozelkod: TStringField;
    spFaturakdvtopl: TBCDField;
    spFaturaGenelToplam: TBCDField;
    spFaturaSatSay: TIntegerField;
    spFaturaYazdirildi: TStringField;
    spFaturairsBilisNo: TIntegerField;
    spFaturaTopsatisk: TBCDField;
    spFaturaYekun: TBCDField;
    spFaturahesapkodu: TStringField;
    spFatHarstokkodu: TStringField;
    spFatHarcinsi: TStringField;
    spFatHarHarTipi: TStringField;
    FatAra: TADOQuery;
    procedure spStokGRUPChange(Sender: TField);
    procedure spFatHarAfterInsert(DataSet: TDataSet);
  private


  public    { Public declarations }
  end;

var
  dm: Tdm;

implementation

{$R *.DFM}


procedure Tdm.spStokGRUPChange(Sender: TField);
begin
  spstok.FieldByName('agrup').asString:=''
end;

procedure Tdm.spFatHarAfterInsert(DataSet: TDataSet);
begin
  DataSet.FieldByName('HarTipi').AsString:='S';
end;

end.


//showmessage('Geldi 3');
{
select bilisno,
CCrikodu=(Select carikodu from cari where cari.carikod=fatura.carikod),
CfirmaAdi=(Select FirmaAdi from cari where cari.carikod=fatura.carikod),
CSoyAdi=(Select SoyAdi from cari where cari.carikod=fatura.carikod),
Tipi,
HesapKodu,
belgeno,
belgetarihi  from fatura
where  (belgetarihi>= :J)

}
